import { RouterModule, Router, Route, Routes, ActivatedRoute } from "@angular/router";
import { NgModule } from "@angular/core";

import { QuoteComponent } from "./quote.component";
import { QuoteTableComponent } from "./quote-table/quote-table.component";
import { QuoteBlockComponent } from "./quote-block/quote-block.component";
import { QuoteindexComponent } from "./quote-index/quote-index.component";
import { QuoteOverviewComponent } from "./quote-overview/quote-overview.component";
import { QuoteCommonTableComponent } from "./quote-common-table/quote-common-table.component";
import { QuoteTreemapComponent } from "./quote-treemap/quote-treemap.component";
import { AuthGuardService, AuthGuardModule } from "auth-guard";

const quoteRoutes: Routes = [
  {
    path: "quote",
    component: QuoteComponent,
    canActivateChild: [
      AuthGuardService
    ],
    children: [
      {
        path: "",
        component: QuoteOverviewComponent
      },
      {
        path: "overview",
        component: QuoteOverviewComponent
      },
      {
        path: "",
        pathMatch: "full",
        redirectTo: "overview"
      },
      {
        path: "block",
        children: [
          {
            path: "",
            pathMatch: "full",
            redirectTo: "GN"
          }, {
            path: ":id",
            component: QuoteBlockComponent
          }
        ]
      },
      {
        path: "treemap",
        children: [
          {
            path: "",
            pathMatch: "full",
            redirectTo: "GN"
          }, {
            path: ":id",
            component: QuoteTreemapComponent
          }
        ]
      },
      {
        path: "index",
        children: [
          {
            path: "",
            pathMatch: "full",
            redirectTo: "common"
          }, {
            path: ":id",
            component: QuoteindexComponent
          }
        ]
      },
      {
        path: ":id",
        component: QuoteCommonTableComponent
      }
    ]
  }
];

@NgModule({
  imports: [
    RouterModule.forChild(quoteRoutes)
  ],
  exports: [
    RouterModule
  ]
})
export class QuoteRoutingModule {

}